import tab from './tab'
import auth from './auth'
import modal from './modal'
import request from '@/utils/request'

export default {
  install(Vue) {
    // 页签操作
    Vue.prototype.$tab = tab
    // 认证对象
    Vue.prototype.$auth = auth
    // 模态框对象
    Vue.prototype.$modal = modal
    // HTTP请求对象
    Vue.prototype.$http = {
      get: (url, params) => request({ url, method: 'GET', params }),
      post: (url, data) => request({ url, method: 'POST', data }),
      put: (url, data) => request({ url, method: 'PUT', data }),
      delete: (url, params) => request({ url, method: 'DELETE', params })
    }
  }
}
